/**
 * 
 */
package com.jinmei.web.action;

import java.util.List;

import com.jinmei.model.WorkScheduleSetting;
import com.jinmei.service.WorkScheduleSettingService;

/**
 * @author richard
 *
 */
public class WorkScheduleDayBaseAction extends BaseAction {

	private static final long serialVersionUID = -59538134202464614L;
	
	private WorkScheduleSettingService workScheduleSettingService;
	
	protected List<WorkScheduleSetting> workingtypes;
	protected String abselectflag;

	public List<WorkScheduleSetting> getWorkingtypes() {
		if (this.workingtypes == null) {
			setWorkingtypes();
		}
		return this.workingtypes;
	}

	private void setWorkingtypes() {
		this.workingtypes = getWorkScheduleSettingService().loadAll();
	}
	
	public WorkScheduleSettingService getWorkScheduleSettingService() {
		return workScheduleSettingService;
	}

	public void setWorkScheduleSettingService(
			WorkScheduleSettingService workScheduleSettingService) {
		this.workScheduleSettingService = workScheduleSettingService;
	}
	
	public String getAbselectflag() {
		return abselectflag;
	}

	public void setAbselectflag(String abselectflag) {
		this.abselectflag = abselectflag;
	}
	
	public void setUserSessionIdAndUsername() {
		super.setUserSessionIdAndUsername();
		setWorkingtypes();
		setAbselectflag(String.valueOf(getWorkingtypes().get(0).getAbselectflag()));
	}
	
}
